package com.atguigu.contacts;

import java.util.Arrays;
import java.util.Scanner;

public class BubbleSrot {
	public static void main(String[] args) {
		double[] arr22 = new double[5];
//		System.out.println(arr22[0]);
		int[] arr = new int[]{49,38,65,97,76,13,27,49};
		int count = 0;
		for (int i = 0; i < arr.length -1; i++) {
			for (int j = 0; j < arr.length - 1-i; j++) {
				count++;
				if (arr[j]>arr[j+1]) {
					int temp = arr[j];
					arr[j] = arr[j + 1];
					arr[j + 1] = temp;
				}
				
			}
		}
		System.out.println("count:" + count);
		System.out.println(Arrays.toString(arr));
	}
}
